package com.lyf.hdc.controller;


import com.lyf.hdc.api.result.Result;
import com.lyf.hdc.dto.ProductionDto;
import com.lyf.hdc.service.ProductionService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "产量管理模块")
@ApiSupport(author = "lyf", order = 7)
@RestController
@RequestMapping("/production")
public class ProductionController {

    @Autowired
    private ProductionService productionService;


    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "生产计划：批量创建")
    @PostMapping("/batchCreate")
    public Result batchCreate(@RequestBody List<ProductionDto> dtoList){
        return productionService.batchCreate(dtoList);
    }


    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "修改生产计划")
    @PostMapping("/edit")
    public Result edit(@RequestBody ProductionDto dto){
        return productionService.edit(dto);
    }

}
